import { defHttp } from "@/utils/http";
// ERP 仓库单据 VO
export interface WhsDocsVO {
	id: number; // 主键ID,示例值(11029)
	receiptYear: string; // 年份
	parentId: number; // 父级ID,示例值(6842)
	receiptDate: string; // 日期
	deptId: string; // 科室代码,示例值(16923)
	type: number; // 类型代码,示例值(1)
	receiptNo: number; // 单据编号
	printType: number; // 打印类型,示例值(1)
	whsId: string; // 仓库代码,示例值(20207)
	sqNumb: number; // 序号
	printCount: number; // 打印次数,示例值(21941)
	receiverId: string; // 领取人,示例值(12775)
}

// ERP 仓库单据 API
export const WhsDocsApi = {
	// 查询仓库单据分页
	getWhsDocsPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/receipts/page`, params });
	},

	// 查询仓库单据详情
	getWhsDocs: async (id: number) => {
		return await defHttp.get({ url: `/whs/receipts/get?id=` + id });
	},

	// 新增仓库单据
	createWhsDocs: async (data: WhsDocsVO) => {
		return await defHttp.post({ url: `/whs/receipts/create`, data });
	},

	// 修改仓库单据
	updateWhsDocs: async (data: WhsDocsVO) => {
		return await defHttp.put({ url: `/whs/receipts/update`, data });
	},

	// 删除仓库单据
	deleteWhsDocs: async (id: number) => {
		return await defHttp.delete({ url: `/whs/receipts/delete?id=` + id });
	},

	// 导出仓库单据 Excel
	exportWhsDocs: async (params: any) => {
		return await defHttp.download({ url: `/whs/receipts/export-excel`, params });
	}
};
